package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SysUserAccount;
import com.ruoyi.system.service.ISysUserAccountService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.Resource;

import java.util.List;

@RestController
@RequestMapping(value = "/account")
public class SysAccountController extends BaseController {

    @Resource
    private ISysUserAccountService iSysUserAccountService;

    @GetMapping(value = "/getAccountList")
    private TableDataInfo getMyKeyTableDataInfo(SysUserAccount sysUserAccount) {
        startPage();
        List<SysUserAccount> sysUserAccountList = iSysUserAccountService.selectPageList(sysUserAccount);
        return getDataTable(sysUserAccountList);
    }

    @PostMapping(value = "/shutDown")
    private AjaxResult shutDown(String account){
        return  iSysUserAccountService.shutDown(account);
    }
}
